FROM openjdk:17-slim

# 设置时区
RUN apt-get update && \
    apt-get install -y --no-install-recommends tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

# 添加应用jar包
COPY target/*.jar app.jar

# 创建日志目录
RUN mkdir -p /app/logs && chmod 777 /app/logs

# 暴露应用端口
EXPOSE 8080

# 设置容器启动命令
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app/app.jar"] 